﻿using System;
using Microsoft.Phone.Tasks;

namespace Com.PhilChuang.Pmvp.Model.Services.Impl
{
	public class SendEmailService : ISendEmailService
	{
		public SendEmailService ()
		{
		}

		#region ISendEmailService Members
		public bool Send (String to, String subject, String body)
		{
			try
			{
				var msg = new EmailComposeTask ();

				msg.To = to;
				msg.Subject = subject;
				msg.Body = body;

				msg.Show ();
				return true;
			}
			catch (Exception)
			{
				return false;
			}
		}
		#endregion

		#region IDisposable Members
		public void Dispose ()
		{
			// does nothing
		}
		#endregion
	}
}
